package com.iscreen.core.services.downloader;

import javax.ejb.Stateless;

import org.jboss.ejb3.annotation.RemoteBinding;

import com.iscreen.utils.download.FileDownloader;
import com.iscreen.utils.exceptions.IScreenException;

/**
 * Session Bean implementation class DownloaderBean
 */
@Stateless
@RemoteBinding(jndiBinding="Downloader")
public class DownloaderBean implements Downloader {

    /**
     * Default constructor. 
     */
    public DownloaderBean() {
        // TODO Auto-generated constructor stub
    }

    public void download(DownloadMessage downloadMessage)
    {
    	try
		{
			FileDownloader.download(downloadMessage.getSource(), downloadMessage.getDestination());
		}
		catch (IScreenException e)
		{
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
    }
}
